#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import passageinfo_blueprint
from api_1_0.passageInfoResource.passageInfoResource import PassageInfoResource
from api_1_0.passageInfoResource.passageInfoOtherResource import PassageInfoOtherResource

api = Api(passageinfo_blueprint)

api.add_resource(PassageInfoResource, '/passageInfo/<AutoID>', '/passageInfo', endpoint='passageInfo')


# joint query
@passageinfo_blueprint.route('/passageInfo/query', methods=['GET'], endpoint='passageInfo_query')
def PassageInfo_query():
    return PassageInfoOtherResource.joint_query()


#Api缺陷 过度数据暴露
@passageinfo_blueprint.route('/passageInfo/userreadv1', methods=['GET'], endpoint='passageInfo_userread_vulnerability_3')
def PassageInfo_userread_vulnerability_3():
    return PassageInfoOtherResource.userread_vulnerability_3()

# @passageinfo_blueprint.route('/passageInfo/userread', methods=['GET'], endpoint='passageInfo_userread')
# def PassageInfo_userread():
#     return PassageInfoOtherResource.userread()

# Api缺陷 批量分配
@passageinfo_blueprint.route('/passageInfo/update_v1', methods=['PUT'], endpoint='passageInfo_updatev1')
def passageInfo_updatev1():

    return PassageInfoOtherResource.updatev1()

# @passageinfo_blueprint.route('/passageInfo/update_v2', methods=['PUT'], endpoint='passageInfo_updatev2')
# def passageInfo_updatev2():
#     return PassageInfoOtherResource.updatev2()



# #图片的处理
# @passageinfo_blueprint.route('/passageInfo/pic', methods=['POST'], endpoint='passageInfo_pic')
# def PassageInfo_pic():
#     return PassageInfoOtherResource.pic()
#
# # 点击头像获取所有文章
# @passageinfo_blueprint.route('/passageInfo/getoneall', methods=['GET'], endpoint='passageInfo_getoneall')
# def PassageInfo_getoneall():
#     return PassageInfoOtherResource.getoneall()
#
# #模糊查询
# @passageinfo_blueprint.route('/passageInfo/fuzzyquery',methods=['GET'],endpoint='passageInfo_fuzzyquery')
# def PassageInfo_fuzzyquery():
#     return PassageInfoOtherResource.fuzzy_query()
# #推荐首页
# @passageinfo_blueprint.route('/passageInfo/recommend',methods=['GET'],endpoint='passageInfo_recommend')
# def PassageInfo_recommend():
#     return PassageInfoOtherResource.recommend()
#
# #热门推荐
# @passageinfo_blueprint.route('/passageInfo/toprecommend',methods =['GET'],endpoint='passageInfo_toprecommend')
# def PassageInfo_toprecommend():
#     return PassageInfoOtherResource.toprecommend()
#
# #按照系查找
# @passageinfo_blueprint.route('/passageInfo/deptquery',methods=['GET'],endpoint='passageInfo_deptquery')
# def PassageInfo_deptquery():
#     return PassageInfoOtherResource.deptquery()
#
# #级联删除
# @passageinfo_blueprint.route('/passageInfo/deletepassage', methods=['DELETE'], endpoint='passageInfo_deletepassage')
# def PassageInfo_deletepassage():
#     return PassageInfoOtherResource.deletepassage()

# #用户查看已发布文章
# @passageinfo_blueprint.route('/passageInfo/userpublish', methods=['GET'], endpoint='passageInfo_userpublish')
# def PassageInfo_userpublish():
#     return PassageInfoOtherResource.userpublish()
